package jge.renderer;

import jge.datatypes.RESULT;
import jge.renderer.impl.OpenGLDevice;

public class JGERenderer {
	public static enum RENDERAPI {
		OPENGL
	}
	
	private JGERenderDevice device;
	
	public JGERenderer() {
		
	}

	@Override
	protected void finalize() throws Throwable {
		this.Release();
		super.finalize();
	}
	
	
	public RESULT CreateDevice(RENDERAPI api) {
		switch (api) {
		case OPENGL:
			this.device = new OpenGLDevice();
			return RESULT.OK;
			
		default:
			return RESULT.FAIL;
		}
	}
	
	public void Release() {
		this.device.Release();
		this.device = null;
	}
	
	public JGERenderDevice GetDevice() {
		return this.device;
	}
	
}
